<?php

/*
|--------------------------------------------------------------------------
| Home Routes 前台路由
|--------------------------------------------------------------------------
|
|
*/

//首页
Route::get('/','Home\IndexController@index');
//商品
Route::get('/product','Home\ProductController@index');
Route::get('/single/{proid}','Home\ProductController@show');
Route::get('/cart','Home\CartController@index');

/*
|--------------------------------------------------------------------------
| Admin Routes 后台路由
|--------------------------------------------------------------------------
|
|
*/


//首页模块
Route::resource('admin/index','Admin\IndexController',['only'=>['index']]);
//会员模块
Route::get('admin/member/v_code/{id}','Admin\MemberController@v_code');
Route::resource('admin/member','Admin\MemberController',['except'=>['destroy']]);

//广告管理
Route::resource('admin/ad','Admin\AdController');

/*后台消息管理*/
//收件箱
Route::resource('admin/message/receive','Admin\MessageController@receive');
//已发送
Route::resource('admin/message/send','Admin\MessageController@send');
//已删除
Route::resource('admin/message/delete','Admin\MessageController@delete');
Route::resource('admin/message/dodelete','Admin\MessageController@dodelete');
Route::resource('admin/message','Admin\MessageController');
//评价管理
Route::resource('admin/comment','Admin\CommentController');

/*
|--------------------------------------------------------------------------
| Home Routes 前台路由
|--------------------------------------------------------------------------
|
|
*/
//前台首页
Route::get('home/index','Home\IndexController@index');
//
//我的小屋
Route::get('/home/myhouse/index','Home\MyhouseController@index');

//收件箱
Route::resource('home/myhouse/message/receive','Home\MessageController@receive');
//已发送
Route::get('home/myhouse/message/send','Home\MessageController@send');
//已删除
Route::resource('home/myhouse/message/delete','Home\MessageController@delete');
Route::resource('home/myhouse/message/dodelete','Home\MessageController@dodelete');
Route::resource('home/myhouse/message','Home\MessageController');

//后台首页模块
Route::resource('admin/index','Admin\IndexController',['only'=>['index']]);
//后台会员模块
Route::get('admin/member/v_code/{id}','Admin\MemberController@v_code');
Route::resource('admin/member','Admin\MemberController',['except'=>['destroy']]);
Route::resource('admin/manage','Admin\ManageController');

//前台登录
Route::get('/login','Home\LoginController@login');
Route::post('/dologin','Home\LoginController@doLogin');
Route::get('/v_code/{id}','Home\LoginController@v_code');

//前台注册
Route::get('/register','Home\RegisterController@register');
Route::post('/doregister','Home\RegisterController@doRegister');
Route::get('/createcode/{id}','Home\RegisterController@createCode');


//后台登录
Route::get('/admin/login','Admin\LoginController@login');
Route::post('/admin/dologin','Admin\LoginController@doLogin');



//商品分类
Route::get('admin/classify',"Admin\ClassifyController@index");
//品牌编辑
Route::get('admin/classify/{id}/brandedit',"Admin\ClassifyController@brandedit");
//商品编辑页面的验证码路由
Route::get('admin/classify/v_code/{id}','Admin\ClassifyController@v_code');
//品牌更新
Route::post('admin/classify/brandupdate',"Admin\ClassifyController@brandupdate");
//商品属性
Route::get('admin/classifyattr',"Admin\ClassifyController@classifyattr");

//支付方式
Route::get('admin/paymentmode',"Admin\PaymentmodeController@paymentmode");
//送货地区
Route::get('admin/region',"Admin\RegionController@region");
//送货地区编辑
Route::get('admin/region/{id}/regionedit',"Admin\RegionController@regionedit");
//送货地区更新
Route::post('admin/region/regionupdate',"Admin\RegionController@regionupdate");

//添加友情链接
Route::get('admin/frilink/add',"Admin\FrilinkController@add");
//添加友情链接
Route::post('admin/frilink/insert',"Admin\FrilinkController@insert");
//编辑友情链接
Route::get('admin/frilink/{id}/edit',"Admin\FrilinkController@edit");
//更新友情链接
Route::post('admin/frilink/update',"Admin\FrilinkController@update");
//修改状态
Route::get('admin/frilink/{id}/status',"Admin\FrilinkController@status");
//删除友情链接
Route::get('admin/frilink/{id}/delete',"Admin\FrilinkController@delete");
//友情链接
Route::get('admin/frilink',"Admin\FrilinkController@frilink");



//订单列表
Route::get('admin/order',"Admin\OrderController@index");
//订单状态修改
Route::get('admin/order/{id}/statusedit',"Admin\OrderController@statusedit");
//更新订单状态
Route::post('admin/order/update',"Admin\OrderController@update");
//商品模块

Route::resource('admin/product','Admin\ProductController',['except'=>['destroy']]);
//属性列表
Route::put('admin/productattrlist/{proid}','Admin\ProductAttrController@index');
//属性添加
Route::get('admin/productattr/{newproid}','Admin\ProductAttrController@create')->name('createattr');
//继续添加属性
Route::post('admin/productattrnext','Admin\ProductAttrController@storenext');
//处理添加属性 转到商品列表
Route::post('admin/productattr','Admin\ProductAttrController@store');
//属性更改
Route::get('admin/productattr/{pro_id}/edit/{cosir_id}','Admin\ProductAttrController@edit');
//处理属性更改
Route::post('admin/productattrupdate','Admin\ProductAttrController@update');

//重置密码
Route::get('/reset','Home\ResetController@reset');
Route::post('/send','Home\ResetController@send');
Route::get('/info','Home\ResetController@info');
Route::get('/new/id/{id}/token/{token}','Home\ResetController@newpass');
Route::get('/newform','Home\ResetController@newform');
Route::get('/update','Home\ResetController@update');





